package com.lu.user.remote;

import com.lu.netty.annotation.Remote;
import com.lu.netty.util.Response;
import com.lu.netty.util.ResponseUtil;
import com.lu.user.model.User;
import com.lu.user.service.UserService;
import org.springframework.beans.factory.annotation.Autowired;

import java.util.List;

/**
 * @author xiaolu
 * @version 1.0
 * @date 2021-02-03 17:22
 */
@Remote
public class UserRemoteImpl implements UserRemote {

    @Autowired
    private UserService userService;

    public Object saveUser(User user) {
        userService.save(user);
        return ResponseUtil.createSuccessResult(user);
    }

    public Object saveUsers(List<User> users) {
        userService.saveList(users);
        return ResponseUtil.createSuccessResult(users);
    }
}
